home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Common / mfcutil.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  2.3 KB  |  59 lines

  1. //------------------------------------------------------------------------------
  2. // File: MFCUtil.h
  3. //
  4. // Desc: DirectShow sample code - prototypes for utility functions
  5. //       used by MFC applications.
  6. //
  7. // Copyright (c) 2000-2001 Microsoft Corporation.  All rights reserved.
  8. //------------------------------------------------------------------------------
  9.  
  10. //
  11. // Application-defined messages
  12. //
  13. #define WM_GRAPHNOTIFY  WM_APP + 1
  14.  
  15. #ifndef SAFE_RELEASE
  16. #define SAFE_RELEASE(x)  if(x) {x->Release(); x=0;}
  17. #endif
  18.  
  19. #define JIF(x) if (FAILED(hr=(x))) \
  20.     {RetailOutput(TEXT("FAILED(0x%x) ") TEXT(#x) TEXT("\n"), hr); goto CLEANUP;}
  21.  
  22. //
  23. //  Function prototypes
  24. //
  25. HRESULT AddGraphFiltersToList (IGraphBuilder *pGB, CListBox& m_ListFilters);
  26. HRESULT AddFilterPinsToLists  (IGraphBuilder *pGB, CListBox& m_ListFilters, 
  27.                                CListBox& m_ListPinsInput, CListBox& m_ListPinsOutput);
  28.  
  29. HRESULT EnumPinsOnFilter (IBaseFilter *pFilter, PIN_DIRECTION PinDir, CListBox& Listbox);
  30.  
  31. // Enumeration functions that add extra data to the listbox
  32. HRESULT EnumFiltersAndMonikersToList(IEnumMoniker *pEnumCat, CListBox& ListFilters);
  33. HRESULT EnumFiltersAndCLSIDsToList(IEnumMoniker *pEnumCat, CListBox& ListFilters);
  34.  
  35. HRESULT EnumFiltersWithCLSIDToList(ICreateDevEnum *pSysDevEnum, 
  36.                                    const GUID *clsid, CListBox& List);
  37. HRESULT EnumFiltersWithMonikerToList(ICreateDevEnum *pSysDevEnum, 
  38.                                    const GUID *clsid, CListBox& List);
  39.  
  40. // Similar to IGraphBuilder::FindFilterByName()
  41. IBaseFilter *FindFilterFromName(IGraphBuilder *pGB, LPTSTR szNameToFind);
  42.  
  43. // Listbox add/clear functions that store extra data
  44. void AddFilterToListWithCLSID  (const TCHAR *szFilterName, 
  45.                                 const GUID *pCatGuid, CListBox& ListFilters);
  46. void AddFilterToListWithMoniker(const TCHAR *szFilterName, 
  47.                                 IMoniker *pMoniker, CListBox& ListFilters);
  48. void ClearFilterListWithCLSID  (CListBox& ListFilters);
  49. void ClearFilterListWithMoniker(CListBox& ListFilters);
  50.  
  51. // Listbox manipulation functions
  52. void AddEventToList(CListBox& ListEvents, long lEventCode);
  53. void AddFilterCategoriesToList(CListBox& ListFilters);
  54.  
  55. // Debug output
  56. void RetailOutput(TCHAR *tszErr, ...);
  57.  
  58. BOOL GetFileInfoStrings(LPTSTR szFile, TCHAR *szSize, TCHAR *szDate);
  59.